import 'package:elephant_fish/page/family_create_page.dart';
import 'package:elephant_fish/page/family_join_page.dart';
import 'package:elephant_fish/util/size_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class FamilyManagerPage extends StatefulWidget {
  const FamilyManagerPage({Key key}) : super(key: key);

  @override
  _FamilyManagerPageState createState() => _FamilyManagerPageState();
}

class _FamilyManagerPageState extends State<FamilyManagerPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color(0xff140c3d),
      appBar: AppBar(
        backgroundColor: Color(0xff140c3d),
        centerTitle: true,
        leading: GestureDetector(
          child: Icon(
            Icons.arrow_back_ios,
            size: SizeUtil.px(32),
            color: Color(0xfff3f3f3),
          ),
          onTap: () {
            Navigator.pop(context);
          },
        ),
        title: Text(
          '家族管理',
          style: TextStyle(fontSize: SizeUtil.px(32), color: Color(0xfff5f5f5)),
        ),
      ),
      body: Column(
        children: [
          Padding(
            padding: EdgeInsets.only(top: SizeUtil.px(130)),
            child: Align(
              alignment: Alignment.topCenter,
              child: Image.asset(
                'assets/images/family_logo.png',
                width: SizeUtil.px(301),
                height: SizeUtil.px(301),
              ),
            ),
          ),
          SizedBox(
            height: SizeUtil.px(80),
          ),
          Align(
            alignment: Alignment.topCenter,
            child: Text(
              '您还没有加入家族哦',
              style: TextStyle(
                  fontSize: SizeUtil.px(29), color: Color(0xffe1e1e1)),
            ),
          ),
          SizedBox(
            height: SizeUtil.px(47),
          ),
          Align(
            alignment: Alignment.topCenter,
                child: Container(
                  width: SizeUtil.px(517),
                  child: Text(
                    '通过家族玩法，您将获得更多的奖励，快来加入吧！',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                        fontSize: SizeUtil.px(29), color: Color(0xff818181)),
                  ),
                )

            ),
          SizedBox(
            height: SizeUtil.px(80),
          ),
          Align(
            alignment: Alignment.topCenter,
            child: InkWell(
              child: Container(
                width: SizeUtil.px(517),
                height: SizeUtil.px(73),
                decoration: BoxDecoration(
                  border: Border.all(color: Color(0xffe62d6c),width: 1),
                  borderRadius: BorderRadius.all(Radius.circular(SizeUtil.px(43))),
                ),
                child: Center(
                  child: Text(
                    '我要加入',
                    style: TextStyle(
                        fontSize: SizeUtil.px(28), color: Color(0xfff3f3f3)),
                  ),
                ),
              ),
              onTap: (){
                Navigator.of(context).push( MaterialPageRoute(builder: (context)=>FamilyJoinPage()));
              },
            )
          ),
          SizedBox(height: 30,),
          Align(
              alignment: Alignment.topCenter,
              child: InkWell(
                child: Container(
                  width: SizeUtil.px(517),
                  height: SizeUtil.px(73),
                  decoration: BoxDecoration(
                    color: Color(0xffe62d6c),
                    borderRadius: BorderRadius.all(Radius.circular(SizeUtil.px(43))),
                  ),
                  child: Center(
                    child: Text(
                      '创建家族',
                      style: TextStyle(
                          fontSize: SizeUtil.px(28), color: Color(0xfff3f3f3)),
                    ),
                  ),
                ),
                onTap: (){
                  Navigator.of(context).push( MaterialPageRoute(builder: (context)=>FamilyCreatePage()));
                },
              )
          ),
        ],
      ),
    );
  }
}
